package com.suda.sudaexamsystem.pojo;

import com.suda.sudaexamsystem.dto.ClazzDto;

import java.util.ArrayList;
import java.util.List;

/**
 * 班级信息表
 */
public class Clazz {
    private int id;
    private String name;
    // 班级所有者
    private User owner;
    // 班级中的人员
    private List<User> userList = new ArrayList<>();
    // 班级的试卷
    private List<ExamPaper> paperList = new ArrayList<>();

    public ClazzDto toDto() {
        return new ClazzDto(id, name, null);
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public User getOwner() {
        return owner;
    }

    public void setOwner(User owner) {
        this.owner = owner;
    }

    public List<User> getUserList() {
        return userList;
    }

    public void setUserList(List<User> userList) {
        this.userList = userList;
    }

    public List<ExamPaper> getPaperList() {
        return paperList;
    }

    public void setPaperList(List<ExamPaper> paperList) {
        this.paperList = paperList;
    }

    @Override
    public String toString() {
        return "Clazz{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", paperList=" + paperList +
                '}';
    }
}
